package factoryMethod;

import java.io.IOException;
import java.util.Date;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 
 * 使用工厂方法创建Bean
 * 
 * @author Wangpeihu
 * @team [Never give up]
 * @since JDK1.6(建议)
 * @date 2010-2-4
 */
public class Test {

	public static void main(String[] args) throws IOException {
		ApplicationContext context = new ClassPathXmlApplicationContext(
				"factoryMethod/applicationContext.xml");

		Date date = (Date) context.getBean("date");
		System.out.println(date);
	}

}
